cmake_minimum_required(VERSION 3.16.0)  
project(UNITTEST_TEST)
set(gloglib ${CMAKE_CURRENT_SOURCE_DIR}/glog/lib/libglog.a)
# build.bat define the definitions
if(ut)
    enable_testing()
    add_subdirectory(googletest-1.17.0) # add gtest library
    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.17.0/googletest/include)
    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/googletest-1.17.0/googlemock/include)
    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/glog/include) 
    add_definitions(-Dgtest_main=main)
    add_subdirectory(workspace)
    # generate integrationtest.exe file
    add_executable(unittest ${PROJECT_SOURCE_DIR}/test_case.cpp)
    # link driver library to project
    target_link_libraries(unittest 
                    PUBLIC
                    user_lib
                    ${gloglib}
                    gtest
                    gtest_main
                    gmock
                    gmock_main 
                    pthread)
    message(STATUS "UNITTEST=ON")
else()
    message(STATUS "UNITTEST=OFF")
endif(ut)
find_package(Threads)
##/******************* (C) COPYRIGHT 2025 PHOTONIC *****END OF FILE****/